import java.sql.SQLOutput;
import java.util.Scanner;

/**
 * ClassName: Array
 * Package: PACKAGE_NAME
 * Description:
 *
 * @Author 蒋林康
 * @Create 2023/9/18 22:12
 * @Version 1.0
 */
public class Array {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入学生人数:");
        int count=scan.nextInt();

        int[] scores=new int[count];
        System.out.println("请输入"+count+"名学生的分数：");
        int maxScore=scores[0];
        for (int i = 0; i < scores.length; i++) {
            scores[i]=scan.nextInt();
            if (maxScore<scores[i]){
                maxScore=scores[i];
            }
        }
        System.out.println("最高分为："+maxScore);
        char score=0;
        for (int j = 0; j < scores.length; j++) {
            if (scores[j]>=maxScore-10){
                score='A';
            } else if (scores[j]>=maxScore-20) {
                score='B';
            } else if (scores[j]>=maxScore-30) {
                score='C';
            }else {
                score='D';
            }
            System.out.println("student "+j+"score is "+scores[j]+" grade is "+score);
        }
    }
}
